﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="STYLESHEET" type="text/css" id="SkinStyleSheet">
<title>WebNoteEditor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>
<script language="vbscript" src="../script/window.vbs"></Script>
<script language="vbscript">
dim MarqueeObject,EditorWindow

set EditorWindow=window.dialogArguments.document.parentWindow.parent
SkinStyleSheet.href="../"&EditorWindow.WebNoteSkinResourcePath&"editor.css"

Sub Window_onload()
	Set MarqueeObject=window.dialogArguments
	'取得滚动对象的内容
	content.value=MarqueeObject.innerhtml
	
	'取得滚动对象背景颜色
	if MarqueeObject.bgcolor<>"" then
		BgColor.value=MarqueeObject.bgcolor
		BtnSetBgColor.style.backgroundcolor=BgColor.value
	end if
	'取得滚动对象宽度
	if MarqueeObject.width<>"" then
		CheckBoxWidth.checked=True
		width.disabled=false
		Widthpx(0).disabled=false
		Widthpx(1).disabled=false
		if instr(MarqueeObject.width,"%")>0 then
			width.value=replace(MarqueeObject.width,"%","")
			Widthpx(1).checked=True
		else
			width.value=MarqueeObject.width
		end if
	end if
	if MarqueeObject.style.width<>"" then
		CheckBoxWidth.checked=True
		width.disabled=false
		Widthpx(0).disabled=false
		Widthpx(1).disabled=false
		if instr(MarqueeObject.style.width,"%")>0 then
			width.value=replace(MarqueeObject.style.width,"%","")
			Widthpx(1).checked=True
		else
			width.value=MarqueeObject.style.width
		end if
	end if
	'取得滚动对象高度
	if MarqueeObject.Height<>"" then
		CheckBoxHeight.checked=True
		Height.disabled=false
		Heightpx(0).disabled=false
		Heightpx(1).disabled=false
		if instr(MarqueeObject.Height,"%")>0 then
			Height.value=replace(MarqueeObject.Height,"%","")
			Heightpx(1).checked=True
		else
			Height.value=MarqueeObject.Height
		end if
	end if
	if MarqueeObject.style.Height<>"" then
		CheckBoxHeight.checked=True
		Height.disabled=false
		Heightpx(0).disabled=false
		Heightpx(1).disabled=false
		if instr(MarqueeObject.style.Height,"%")>0 then
			Height.value=replace(MarqueeObject.style.Height,"%","")
			Heightpx(1).checked=True
		else
			Height.value=MarqueeObject.style.Height
		end if
	end if
	
	for each it in direction
		if it.value=MarqueeObject.direction then
			it.checked=true
		end if
	next
	
	for each it in behavior
		if it.value=MarqueeObject.behavior then
			it.checked=true
		end if
	next
	scrolldelay.value=MarqueeObject.scrolldelay
	scrollamount.value=MarqueeObject.scrollamount
	if MarqueeObject.loop=-1 then
		CheckBoxLoop.checked=true
		loopvalue.disabled=true
		loopvalue.value=""
	else
		loopvalue.disabled=false
		loopvalue.value=MarqueeObject.loop
	end if
	
	'预览
	BtnPreView_onclick()
	
	Call AutoResizeDialogWindow
End Sub


'设置单元格背景颜色
Sub BtnSetBgColor_Onclick
	dim ReturnColor
	ReturnColor=mmshowModalDialog("dialogcolor.htm",BgColor.value,468,250)
	if ReturnColor<>"" then
		BgColor.value=ReturnColor
		BtnSetBgColor.style.backgroundcolor=BgColor.value
	end if
	
End Sub

Sub CheckBoxwidth_onclick()
	if not CheckBoxwidth.checked then
		CheckBoxwidth.checked=false
		width.value=""
		width.disabled=true
		Widthpx(0).disabled=true
		Widthpx(1).disabled=true
	else
		CheckBoxwidth.checked=true
		width.value=MarqueeObject.style.width
		width.disabled=false
		Widthpx(0).disabled=false
		Widthpx(1).disabled=false
	end if
End Sub

Sub CheckBoxHeight_onclick()
	if not CheckBoxHeight.checked then
		CheckBoxHeight.checked=false
		Height.value=""
		Height.disabled=true
		Heightpx(0).disabled=true
		Heightpx(1).disabled=true
	else
		CheckBoxHeight.checked=true
		Height.value=MarqueeObject.style.height
		Height.disabled=false
		Heightpx(0).disabled=false
		Heightpx(1).disabled=false
	end if
End Sub

Sub CheckBoxLoop_onclick()
	if not CheckBoxLoop.checked then
		loopvalue.disabled=false
		loopvalue.value=1
	else
		loopvalue.disabled=true
		loopvalue.value=""
	end if
End Sub

'确定按钮事件
Sub BtnOk_onclick()
	BtnUse_onclick()
	window.close()
End Sub

Sub BtnCancel_onclick()
	window.close()
End Sub

Sub BtnUse_onclick()
	MarqueeObject.innerhtml=content.value
	MarqueeObject.setAttribute "bgcolor",BgColor.value,0
	
	MarqueeObject.style.width=width.value
	MarqueeObject.style.Height=Height.value
	
	for each it in direction
		if it.checked then
			MarqueeObject.setAttribute "direction",it.value,0
			exit for
		end if
	next
	
	for each it in behavior
		if it.checked then
			MarqueeObject.setAttribute "behavior",it.value,0
			exit for
		end if
	next
	
	MarqueeObject.scrolldelay=scrolldelay.value
	MarqueeObject.scrollamount=scrollamount.value
	
	if CheckBoxLoop.checked then
		MarqueeObject.RemoveAttribute "loop"
	else
		MarqueeObject.setAttribute "loop",loopvalue.value,0
	end if
	
	MarqueeObject.setAttribute "onmouseover","javascript:this.stop()",0
	MarqueeObject.setAttribute "onmouseout","javascript:this.start()",0
	
	window.returnvalue=true
End Sub

Sub BtnPreView_onclick()
	PreView.innerhtml=content.value
	PreView.setAttribute "bgcolor",BgColor.value,0
	
	'MarqueeObject.style.width=width.value
	'MarqueeObject.style.Height=Height.value
	
	for each it in direction
		if it.checked then
			PreView.setAttribute "direction",it.value,0
			exit for
		end if
	next
	
	for each it in behavior
		if it.checked then
			PreView.setAttribute "behavior",it.value,0
			exit for
		end if
	next
	
	PreView.scrolldelay=scrolldelay.value
	PreView.scrollamount=scrollamount.value
	
	if CheckBoxLoop.checked then
		PreView.RemoveAttribute "loop"
	else
		PreView.setAttribute "loop",loopvalue.value,0
	end if
	
	PreView.setAttribute "onmouseover","javascript:this.stop()",0
	PreView.setAttribute "onmouseout","javascript:this.start()",0
End Sub

</script>
</head>

<body class="dialog">
<script language="vbscript" type="text/vbscript">dialogTitle("lang_attribute_marquee")</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td>
	    <fieldset><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_text")</script></legend>
        	<textarea rows="10" name="content" cols="83" class="dialogInput"></textarea>
      	</fieldset>
    </td>
  </tr>
  <tr>
    <td width="100%">
    <table border="0" cellpadding="0" cellspacing="8" style="border-collapse: collapse" bordercolor="#111111">
      <tr>
        <td width="100" valign="top">
        	<fieldset style="height: 100"><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_direction")</script></legend>
        		<input type="radio" value="left" name="direction" checked><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_left")</script><br>
        		<input type="radio" value="right" name="direction"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_right")</script><br>
        		<input type="radio" value="up" name="direction"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_up")</script><br>
        		<input type="radio" value="down" name="direction"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_down")</script>
            </fieldset></td>
        <td width="100" valign="top">
        	<fieldset style="height: 100"><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_speed")</script></legend>
              　			<table border="0" cellpadding="0" cellspacing="0">
          		<tr>
            		<td><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_delay")</script></td>
            		<td><input type="text" name="scrolldelay" size="4" class="dialogInput"></td>
          		</tr>
          		<tr>
            		<td><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_amount")</script></td>
            		<td><input type="text" name="scrollamount" size="4" class="dialogInput"></td>
         		</tr>
        	</table>
        	</fieldset>
        </td>
        <td width="100" valign="top">
            <fieldset style="height: 100"><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_behavior")</script></legend>
        		<input type="radio" value="scroll" checked name="behavior"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_scroll")</script><br>
        		<input type="radio" value="slide" name="behavior"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_slide")</script><br>
        		<input type="radio" value="alternate" name="behavior"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_alternate")</script>
        	</fieldset>
        </td>
        <td width="100" valign="top">
        	<fieldset style="height: 100%"><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_repeat")</script></legend>
        		<input type="checkbox" name="CheckBoxLoop" value="ON"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_sequential")</script><br>
              　<table border="0" cellpadding="0" cellspacing="0">
              	<tr>
                	<td><input type="text" name="loopvalue" size="4" disabled class="dialogInput"></td>
                	<td><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_times")</script></td>
              	</tr>
            	</table>
        	</fieldset> </td>               
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td width="100%">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
      <tr>
        <td valign="top">
        <fieldset><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_size")</script></legend>
        <table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td nowrap><input type="checkbox" name="CheckBoxWidth" value="ON"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_width")</script><input type="text" name="width" size="8" disabled=true class="dialogInput"></td>
            <td nowrap><input type="radio" value="V1" name="Widthpx" checked disabled><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_pixel")</script><br>
            <input type="radio" value="V1" name="Widthpx" disabled><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_percent")</script></td>
          </tr>
          <tr>
            <td nowrap><input type="checkbox" name="CheckBoxHeight" value="ON"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_height")</script><input type="text" name="height" size="8" disabled class="dialogInput"></td>
            <td nowrap><input type="radio" value="V1" checked name="Heightpx" disabled><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_pixel")</script><br>
            <input type="radio" value="V1" name="Heightpx" disabled><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_percent")</script></td>
          </tr>
          <tr>
            <td colspan="2"><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_background_color")</script><input type="text" name="BgColor" size="7" class="dialogInput"><input type="button" name="BtnSetBgColor" class="BtnSelectColor">
            </td>
          </tr>
        </table>
        </fieldset>
        </td>
        <td width="300" valign="top">
            <fieldset><legend><script language="vbscript" type="text/vbscript">dialogPrintlang("lang_preview")</script></legend>
              <p align="right">
    			<marquee id="PreView" width="100%" style="height:76px"></marquee>
    			<input type="button" value="预览" name="BtnPreView" class="SysBTN5">
    		</fieldset>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
<div class="buttons">
	<hr size="1" color="#B3AC9D">
	<script language="vbscript" type="text/vbscript">
		call PrintButtons()
	</script>
</div>

</body>

</html>
